﻿using ElectrodomesticosAbr2014.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ElectrodomesticosAbr2014.Controllers
{
    public class ChangoController : Controller
    {
        public ActionResult Index()
        {
            return View(model: Chango.ElChango);
        }
        
        //
        // GET: /Chango/
        public ActionResult Agregar(Int32 posicion, Int32 cantidad)
        {
            ItemChango itm = new ItemChango();
            itm.producto = Producto.catalogo[posicion];
            itm.cantidad = cantidad;

            Chango.ElChango.Items.Add(itm);

            return RedirectToAction("Index");
        }

    }
}
